﻿using DHQGHN.DAL.DAO.DHQG;
using DHQGHN.DAL.Models.DHQG;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DHQGHN.DAL.BO.DHQG
{
    public class CommentBO : BaseBO
    {
        private CommentDAO _dao;
        public CommentBO()
        {
            _dao = new CommentDAO(Common.ConnectionUtil.DHQGHN_CONNECTION_STRING, DEFAULT_MAPPER_TYPE);
        }
        public bool Save(List<Comment> data)
        {
            try
            {
                return _dao.Save(data);
            }
            catch
            {
                throw;
            }
        }
        public int CommentHuyCHot(int namkh, int ban, int mocks, int mocbefo)
        {
            try
            {
                return _dao.CommentHuyCHot(namkh, ban, mocks, mocbefo);
            }
            catch
            {
                throw;
            }
        }
        public List<Comment> GetallbyDonviGiuaNam(int namkh, int moc)
        {
            try
            {
                return _dao.GetallbyDonviGiuaNam(namkh, moc);

            }
            catch
            {
                throw;
            }
        }
        public List<CheckChot> GetlistCommnetBanchuachot(int namkh, int moc)
        {
            try
            {
                return _dao.GetlistCommnetBanchuachot(namkh, moc);
            }
            catch
            {
                throw;
            }
        }
        public int UpdateCommentbyKHTC_BAN(Comment cm)
        {
            try
            {
                return _dao.UpdateCommentbyKHTC_BAN(cm);
            }
            catch
            {
                throw;
            }
        }
        public List<Comment> GetallComment(int namkh, int moc, int statusid)
        {
            try
            {
                return _dao.GetallComment(namkh, moc, statusid);
            }
            catch
            {
                throw;
            }
        }
        public int InsertGiuanamByBan(Comment cmt)
        {
            try
            {
                return _dao.InsertGiuanamByBan(cmt);
            }
            catch
            {
                throw;
            }
        }
        public int UpdateCommentGiuaNambyDV(Comment cmt)
        {
            try
            {
                return _dao.UpdateCommentGiuaNambyDV(cmt);
            }
            catch
            {
                throw;
            }
        }
        public int UpdateCommentbyKHTC(Comment cm)
        {
            try
            {
                return _dao.UpdateCommentbyKHTC(cm);
            }
            catch
            {
                throw;
            }
        }
        public int UpdateCommentApproveGiuaNam(int namkh, int chitieu, int donvi, int moc, int flag)
        {
            try
            {
                return _dao.UpdateCommentApproveGiuaNam(namkh, chitieu, donvi, moc, flag);
            }
            catch
            {
                throw;
            }
        }
        public List<Comment> GetallGiuanamByDV(int donviid, int namkh, int moc)
        {
            try
            {
                return _dao.GetallGiuanamByDV(donviid, namkh, moc);
            }
            catch
            {
                throw;
            }
        }
        public int CommentChot(int namkh, int ban, int moc)
        {
            try
            {
                return _dao.CommentChot(namkh, ban, moc);
            }
            catch
            {
                throw;
            }
        }
        public List<CheckChot> CommentCheckchot(int namkh, int moc, int ban, int mocks)
        {
            try
            {
                return _dao.CommentCheckchot(namkh, moc, ban, mocks);
            }
            catch
            {
                throw;
            }
        }
        public List<Comment> GetallByBan(int banid, int namkh, int moc, int flag, int mocks)
        {
            try
            {
                return _dao.GetallByBan(banid, namkh, moc, flag, mocks);
            }
            catch
            {
                throw;
            }
        }
        public int UpdateCommentApprove(int namkh, int chitieu, int donvi, int moc, int mocks)
        {
            try
            {
                return _dao.UpdateCommentApprove(namkh, chitieu, donvi, moc, mocks);
            }
            catch
            {
                throw;
            }
        }

        public int DeleteCommentbyBan(int nhomdvid, int nhomct, int namkh, int ban, int moc, int flag)
        {
            try
            {
                return DeleteCommentbyBan(nhomdvid, nhomct, namkh, ban, moc, flag);
            }
            catch
            {
                throw;
            }
        }
        public int UpdateComment(Comment cm)
        {
            try
            {
                return _dao.UpdateComment(cm);
            }
            catch
            {
                throw;
            }
        }
        public int UpdateCommentByBAN(Comment cm)
        {
            try
            {
                return _dao.UpdateCommentByBAN(cm);
            }
            catch
            {
                throw;
            }
        }
        public List<Comment_DV> GetallByDv(int dvid, int namkh, int moc, int flag, int mocks, int nguoidungid)
        {
            try
            {
                return _dao.GetallByDv(dvid, namkh, moc, flag, mocks,nguoidungid);
            }
            catch
            {
                throw;
            }
        }
    }
}
